All Questions
4 questions
4votes
2answers
5kviews
Subtract floating numbers in shell script
I'm trying to do some calculation in shell script with CPU usage. Which return floating point number. But when I subtract this number I'm getting error. See the following code and error. Code #!/bin/...
1vote
6answers
2kviews
Hexadecimal number sequence checker in Linux?
I have a list of hexadecimal number. I would like to check whether they are in sequence or not. That is, they should be consecutive numbers, in increasing order. In other words, there should be an ...
13votes
3answers
39kviews
case + how to implement equal or less or greater in case syntax
My target is to verify a range of number with (only with case + esac), and print the range. So for example: If the number is between 0 and 80, print >=0<=80 If the number is between 81 and 100 ...
4votes
2answers
3kviews
Error when subtracting two negative numbers in ksh: "assignment requires lvalue"
I am trying to debug someone else's script: The code line is: y=$((${oldvalue[$x]}-${newvalue[$x]})) y gets calculated fine as long as both sides are positive numbers. However, I have a production ...